Skip to content

[PB-6258] feat: add attachments type filter to global search - #2070

Merged
victor-ferro merged 42 commits into
PB-6258-search-filters-sdkfrom
PB-6258-search-type-filter
Aug 13, 2026
Merged

[PB-6258] feat: add attachments type filter to global search#2070
victor-ferro merged 42 commits into
PB-6258-search-filters-sdkfrom
PB-6258-search-type-filter

Conversation

@victor-ferro

Copy link
Copy Markdown
Contributor

Description

Part 2/4 of the PB-6258 stack. Adds the "Attachments" pill with a per-category checkbox dropdown, per Figma: "Any type" means no type param is sent, selecting every category normalizes back to it, and a subset shows the indeterminate mark. A second commit exposes the remaining backend categories (txt, code, csv, xml, figma) beyond the 9 in Figma — pending design sign-off, isolated so it can be dropped if rejected. Includes i18n for the 8 locales.

Blocked by internxt/sdk#429 (see base PR #2069).

Related Issues

Relates to PB-6258 (JIRA).

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

Manual browser testing against the local backend: category toggles issue the expected repeated type= params, "Any type" drops the param, deselecting the last category restores it, and focus returns to the search input when the dropdown closes.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 24, 2026

Copy link
Copy Markdown

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 52ebb08
Status:⚡️  Build in progress...

View logs

@victor-ferro
victor-ferro marked this pull request as ready for review July 29, 2026 14:42

@CandelR CandelR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @victor-ferro , I don’t find the way the attachments filter works very intuitive at all.
The fact that selecting ‘Any Type’ selects all the items, but clicking it again doesn’t deselect them all, seems like a poorly implemented ‘Select All’ function. Nor do I find it very intuitive that deselecting the last specific filter selects everything, including the ‘any type’ option.
We should discuss this with the design team, as I don’t think it’s been properly thought through

Comment on lines +50 to +64
<div className="flex flex-row items-center gap-2 px-4 py-2">
<Checkbox checked={isAnyType} indeterminate={!isAnyType} onClick={onSelectAny} />
<p className="text-gray-100">{translate('general.searchBar.filters.anyType')}</p>
</div>
<div className="mx-4 border-t border-gray-10" />
{TYPE_FILTER_ITEMS.map(({ id, labelKey, extension }) => {
const Icon = iconService.getItemIcon(id === 'folder', extension);
return (
<div className="flex flex-row items-center gap-2 px-4 py-2" key={id}>
<Checkbox checked={isAnyType || selected.includes(id)} onClick={() => onToggle(id)} />
<Icon className="h-6 w-6 drop-shadow-soft" />
<p className="text-gray-100">{translate(`general.searchBar.filters.${labelKey}`)}</p>
</div>
);
})}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make clickable all the row instead only the checkbox, ask to designer if have doubts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@victor-ferro victor-ferro self-assigned this Jul 31, 2026
@victor-ferro

Copy link
Copy Markdown
Contributor Author

Okay @CandelR , I'll talk to the design team about this. It also seemed a bit odd to me, but the requirements said that no type filter is applied if all types are selected — therefore, applying no filter is the same as having them all selected. And if, after clicking "any type", you click on a specific type, only that type gets selected. As I said, I'll bring it up with the design team and share this rather unintuitive behaviour with them.

Selecting all types and selecting none are now distinct states instead of
both being represented by an empty selection. "Any type" toggles between
them, and clearing the last category no longer snaps back to everything
selected.

Both states still send no type filter to the server, and the initial state
is still every type selected.
@victor-ferro
victor-ferro requested a review from CandelR August 3, 2026 13:11
…lter

# Conflicts:
#	src/views/Home/components/NavbarGlobalSearch.tsx
#	src/views/Home/components/SearchTypeFilter.tsx
The X that clears a date input was an icon with a mouse handler, so it
could not be reached or activated with the keyboard. It is now a button
that keeps preventing the input from blurring on mouse down while doing
the work on click, which also covers Enter and Space.

The calendar wrapper is marked as presentational: its mouse handler only
exists to keep focus in the input, which is what Sonar's S6848 flags.
Same fix as the date filter: the X that clears a custom size input was an
icon with a mouse handler, unreachable by keyboard. It is now a button
that prevents the input from blurring on mouse down and clears on click.
CandelR
CandelR previously approved these changes Aug 4, 2026

@CandelR CandelR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it feels much better, good work @victor-ferro 🚀

@victor-ferro
victor-ferro merged commit 516f74b into master Aug 13, 2026
6 of 8 checks passed
@victor-ferro
victor-ferro deleted the PB-6258-search-type-filter branch August 13, 2026 08:04
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants